home *** CD-ROM | disk | FTP | other *** search
/ Aminet 51 / Aminet 51 (2002)(GTI - Schatztruhe)[!][Oct 2002].iso / Aminet / util / arc / xadmasterdev.lha / xad / Include / ASM / libraries / xadmaster.i
Encoding:
Text File  |  2002-08-20  |  31.8 KB  |  772 lines

  1.     IFND    LIBRARIES_XADMASTER_I
  2. LIBRARIES_XADMASTER_I    SET    1
  3.  
  4. *
  5. *    $VER: xadmaster.i 12.0 (24.06.2002)
  6. *    xadmaster.library defines and structures
  7. *
  8. *    Copyright © 1998-2001 by Dirk Stöcker
  9. *    All Rights Reserved.
  10. *
  11.  
  12.     IFND    EXEC_LIBRARIES_I
  13.     INCLUDE "exec/libraries.i"
  14.     ENDC
  15.  
  16.     IFND    UTILITY_TAGITEM_I
  17.     INCLUDE "utility/tagitem.i"
  18.     ENDC
  19.  
  20. XADNAME MACRO
  21.     DC.B  'xadmaster.library',0
  22.     ENDM
  23.  
  24. * NOTE: The structures do not have size labels, as they have no fixed
  25. * size. You always need to call xadAllocObject to get them
  26.  
  27. *************************************************************************
  28. *                                    *
  29. *    library base structure                        *
  30. *                                    *
  31. *************************************************************************
  32.  
  33.     STRUCTURE xadMasterBase,LIB_SIZE
  34.     APTR    xmb_SysBase
  35.     APTR    xmb_DOSBase
  36.     APTR    xmb_UtilityBase
  37.     ULONG    xmb_RecogSize        * read only
  38.     APTR    xmb_DefaultName     * name for XADFIF_NOFILENAME (V6)
  39.  
  40. *************************************************************************
  41. *                                    *
  42. *    tag-function call flags                        *
  43. *                                    *
  44. *************************************************************************
  45.  
  46. * input tags for xadGetInfo, only one can be specified per call
  47. XAD_INSIZE        EQU    (TAG_USER+001) * input data size
  48. XAD_INFILENAME        EQU    (TAG_USER+002)
  49. XAD_INFILEHANDLE    EQU    (TAG_USER+003)
  50. XAD_INMEMORY        EQU    (TAG_USER+004)
  51. XAD_INHOOK        EQU    (TAG_USER+005)
  52. XAD_INSPLITTED        EQU    (TAG_USER+006) * (V2)
  53. XAD_INDISKARCHIVE    EQU    (TAG_USER+007) * (V4)
  54. XAD_INXADSTREAM     EQU    (TAG_USER+008) * (V8)
  55. XAD_INDEVICE        EQU    (TAG_USER+009) * (V11)
  56.  
  57. * output tags, only one can be specified per call, xadXXXXUnArc
  58. XAD_OUTSIZE        EQU    (TAG_USER+010) * output data size
  59. XAD_OUTFILENAME     EQU    (TAG_USER+011)
  60. XAD_OUTFILEHANDLE    EQU    (TAG_USER+012)
  61. XAD_OUTMEMORY        EQU    (TAG_USER+013)
  62. XAD_OUTHOOK        EQU    (TAG_USER+014)
  63. XAD_OUTDEVICE        EQU    (TAG_USER+015)
  64. XAD_OUTXADSTREAM    EQU    (TAG_USER+016) * (V8)
  65.  
  66. * object allocation tags for xadAllocObjectA
  67. XAD_OBJNAMESIZE     EQU    (TAG_USER+020) * XADOBJ_FILEINFO, size of needed name space
  68. XAD_OBJCOMMENTSIZE    EQU    (TAG_USER+021) * XADOBJ_FILEINFO, size of needed comment space
  69. XAD_OBJPRIVINFOSIZE    EQU    (TAG_USER+022) * XADOBJ_FILEINFO & XADOBJ_DISKINFO, self use size
  70. XAD_OBJBLOCKENTRIES    EQU    (TAG_USER+023) * XADOBJ_DISKINFO, number of needed entries
  71.  
  72. * tags for xadGetInfo, xadFileUnArc and xadDiskUnArc
  73. XAD_NOEXTERN        EQU    (TAG_USER+050) * do not use extern clients
  74. XAD_PASSWORD        EQU    (TAG_USER+051) * password when needed
  75. XAD_ENTRYNUMBER     EQU    (TAG_USER+052) * number of wanted entry
  76. XAD_PROGRESSHOOK    EQU    (TAG_USER+053) * the progress hook
  77. XAD_OVERWRITE        EQU    (TAG_USER+054) * overwrite file ?
  78. XAD_MAKEDIRECTORY    EQU    (TAG_USER+055) * create directory tree
  79. XAD_IGNOREGEOMETRY    EQU    (TAG_USER+056) * ignore drive geometry ?
  80. XAD_LOWCYLINDER     EQU    (TAG_USER+057) * lowest cylinder
  81. XAD_HIGHCYLINDER    EQU    (TAG_USER+058) * highest cylinder
  82. XAD_VERIFY        EQU    (TAG_USER+059) * verify for disk hook
  83. XAD_NOKILLPARTIAL    EQU    (TAG_USER+060) * do not delete partial/corrupt files (V3.3)
  84. XAD_FORMAT        EQU    (TAG_USER+061) * format output device (V5)
  85. XAD_USESECTORLABELS    EQU    (TAG_USER+062) * sector labels are stored on disk (V9)
  86. XAD_IGNOREFLAGS     EQU    (TAG_USER+063) * ignore the client, if certain flags are set (V11)
  87. XAD_ONLYFLAGS        EQU    (TAG_USER+064) * ignore the client, if certain flags are NOT set (V11)
  88.  
  89. * input tags for xadConvertDates, only one can be passed
  90. XAD_DATEUNIX        EQU    (TAG_USER+070) * unix date variable
  91. XAD_DATEAMIGA        EQU    (TAG_USER+071) * amiga date variable
  92. XAD_DATEDATESTAMP    EQU    (TAG_USER+072) * struct DateStamp
  93. XAD_DATEXADDATE     EQU    (TAG_USER+073) * struct xadDate
  94. XAD_DATECLOCKDATA    EQU    (TAG_USER+074) * struct ClockData
  95. XAD_DATECURRENTTIME    EQU    (TAG_USER+075) * input is system time
  96. XAD_DATEMSDOS        EQU    (TAG_USER+076) * MS-DOS packed format (V2)
  97. XAD_DATEMAC        EQU    (TAG_USER+077) * Mac date variable (V8)
  98. XAD_DATECPM        EQU    (TAG_USER+078) * CP/M data structure (V10)
  99. XAD_DATECPM2        EQU    (TAG_USER+079) * CP/M data structure type 2 (V10)
  100. XAD_DATEISO9660     EQU    (TAG_USER+300) * ISO9660 date structure (V11)
  101.  
  102. * output tags, there can be specified multiple tags for one call
  103. XAD_GETDATEUNIX     EQU    (TAG_USER+080) * unix date variable
  104. XAD_GETDATEAMIGA    EQU    (TAG_USER+081) * amiga date variable
  105. XAD_GETDATEDATESTAMP    EQU    (TAG_USER+082) * struct DateStamp
  106. XAD_GETDATEXADDATE    EQU    (TAG_USER+083) * struct xadDate
  107. XAD_GETDATECLOCKDATA    EQU    (TAG_USER+084) * struct ClockData
  108. XAD_GETDATEMSDOS    EQU    (TAG_USER+086) * MS-DOS packed format (V2)
  109. XAD_GETDATEMAC        EQU    (TAG_USER+087) * Mac date variable (V8)
  110. XAD_GETDATECPM        EQU    (TAG_USER+088) * CP/M data structure (V10)
  111. XAD_GETDATECPM2     EQU    (TAG_USER+089) * CP/M data structure type 2 (V10)
  112. XAD_GETDATEISO9660    EQU    (TAG_USER+320) * ISO9660 date structure (V11)
  113.  
  114. * following tags need locale.library to be installed
  115. XAD_MAKEGMTDATE     EQU    (TAG_USER+090) * make local to GMT time
  116. XAD_MAKELOCALDATE    EQU    (TAG_USER+091) * make GMT to local time
  117.  
  118. * tags for xadHookTagAccess (V3)
  119. XAD_USESKIPINFO     EQU    (TAG_USER+104) * the hook uses xadSkipInfo (V3)
  120. XAD_SECTORLABELS    EQU    (TAG_USER+105) * pass sector labels with XADAC_WRITE (V9)
  121.  
  122. XAD_GETCRC16        EQU    (TAG_USER+120) * pointer to UWORD value (V3)
  123. XAD_GETCRC32        EQU    (TAG_USER+121) * pointer to ULONG value (V3)
  124.  
  125. XAD_CRC16ID        EQU    (TAG_USER+130) * ID for crc calculation (V3)
  126. XAD_CRC32ID        EQU    (TAG_USER+131) * ID for crc calculation (V3)
  127.  
  128. * tags for xadConvertProtection (V4)
  129. XAD_PROTAMIGA        EQU    (TAG_USER+160) * Amiga type protection bits (V4)
  130. XAD_PROTUNIX        EQU    (TAG_USER+161) * protection bits in UNIX mode (V4)
  131. XAD_PROTMSDOS        EQU    (TAG_USER+162) * MSDOS type protection bits (V4)
  132. XAD_PROTFILEINFO    EQU    (TAG_USER+163) * input is a xadFileInfo structure (V11)
  133.  
  134. XAD_GETPROTAMIGA    EQU    (TAG_USER+170) * return Amiga protection bits (V4)
  135. XAD_GETPROTUNIX     EQU    (TAG_USER+171) * return UNIX protection bits (V11)
  136. XAD_GETPROTMSDOS    EQU    (TAG_USER+172) * return MSDOS protection bits (V11)
  137. XAD_GETPROTFILEINFO    EQU    (TAG_USER+173) * fill xadFileInfo protection fields (V11)
  138.  
  139. * tags for xadGetDiskInfo (V7)
  140. XAD_STARTCLIENT     EQU    (TAG_USER+180) * the client to start with (V7)
  141. XAD_NOEMPTYERROR    EQU    (TAG_USER+181) * do not create XADERR_EMPTY (V8)
  142.  
  143. * tags for xadFreeHookAccess (V8)
  144. XAD_WASERROR        EQU    (TAG_USER+190) * error occured, call abort method (V8)
  145.  
  146. * tags for miscellaneous stuff
  147. XAD_ARCHIVEINFO     EQU    (TAG_USER+200) * xadArchiveInfo for stream hooks (V8)
  148. XAD_ERRORCODE        EQU    (TAG_USER+201) * error code of function (V12)
  149.  
  150. * tags for xadAddFileEntry and xadAddDiskEntry (V10)
  151. XAD_SETINPOS        EQU    (TAG_USER+240) * set xai_InPos after call (V10)
  152. XAD_INSERTDIRSFIRST    EQU    (TAG_USER+241) * insert dirs at list start (V10)
  153.  
  154. * tags for xadConvertName (V12)
  155. XAD_PATHSEPERATOR    EQU    (TAG_USER+260) * UWORD *, default is {'/','\\',0} in source charset (V12)
  156. XAD_CHARACTERSET    EQU    (TAG_USER+261) * the characterset of string (V12)
  157. XAD_STRINGSIZE        EQU    (TAG_USER+262) * maximum size of following (V12)
  158. XAD_CSTRING        EQU    (TAG_USER+263) * zero-terminated string (V12)
  159. XAD_PSTRING        EQU    (TAG_USER+264) * lengthed Pascal string (V12)
  160. XAD_XADSTRING        EQU    (TAG_USER+265) * an xad string (V12)
  161. XAD_ADDPATHSEPERATOR    EQU    (TAG_USER+266) * default is TRUE (V12)
  162.  
  163. * tags for xadGetFilename (V12)
  164. XAD_NOLEADINGPATH    EQU    (TAG_USER+280) * default is FALSE (V12)
  165. XAD_NOTRAILINGPATH    EQU    (TAG_USER+281) * default is FALSE (V12)
  166. XAD_MASKCHARACTERS    EQU    (TAG_USER+282) * default are #?()[]~%*:|",1-31,127-160 (V12)
  167. XAD_MASKINGCHAR     EQU    (TAG_USER+283) * default is '_' (V12)
  168. XAD_REQUIREDBUFFERSIZE    EQU    (TAG_USER+284) * pointer which should hold buf size (V12)
  169.  
  170.  
  171. * Places 300-339 used for dates!
  172.  
  173. *************************************************************************
  174. *                                    *
  175. *    objects for xadAllocObjectA                    *
  176. *                                    *
  177. *************************************************************************
  178.  
  179. XADOBJ_ARCHIVEINFO    EQU    $0001 * struct xadArchiveInfo
  180. XADOBJ_FILEINFO     EQU    $0002 * struct xadFileInfo
  181. XADOBJ_DISKINFO     EQU    $0003 * struct xadDiskInfo
  182. XADOBJ_HOOKPARAM    EQU    $0004 * struct HookParam
  183. XADOBJ_DEVICEINFO    EQU    $0005 * struct xadDeviceInfo
  184. XADOBJ_PROGRESSINFO    EQU    $0006 * struct xadProgressInfo
  185. XADOBJ_TEXTINFO     EQU    $0007 * struct xadTextInfo
  186. XADOBJ_SPLITFILE    EQU    $0008 * struct xadSplitFile (V2)
  187. XADOBJ_SKIPINFO     EQU    $0009 * struct xadSkipInfo (V3)
  188. XADOBJ_IMAGEINFO    EQU    $000A * struct xadImageInfo (V4)
  189. XADOBJ_SPECIAL        EQU    $000B * struct xadSpecial (V11)
  190.  
  191. * result type of xadAllocVec
  192. XADOBJ_MEMBLOCK     EQU    $0100 * memory of requested size and type
  193. * private type
  194. #define XADOBJ_STRING    EQU    $0101 * an typed XAD string (V12)
  195.  
  196. *************************************************************************
  197. *                                    *
  198. *    modes for xadCalcCRC126 and xadCalcCRC32                *
  199. *                                    *
  200. *************************************************************************
  201.  
  202. XADCRC16_ID1        EQU    $A001
  203. XADCRC32_ID1        EQU    $EDB88320
  204.  
  205. *************************************************************************
  206. *                                    *
  207. *    hook related stuff                         *
  208. *                                    *
  209. *************************************************************************
  210.  
  211. XADHC_READ    EQU    1    * read data into buffer
  212. XADHC_WRITE    EQU    2    * write buffer data to file/memory
  213. XADHC_SEEK    EQU    3    * seek in file
  214. XADHC_INIT    EQU    4    * initialize the hook
  215. XADHC_FREE    EQU    5    * end up hook work, free stuff
  216. XADHC_ABORT    EQU    6    * an error occured, delete partial stuff
  217. XADHC_FULLSIZE    EQU    7    * complete input size is needed
  218. XADHC_IMAGEINFO EQU    8    * return disk image info (V4)
  219.  
  220.     STRUCTURE xadHookParam,0
  221.     ULONG    xhp_Command
  222.     ULONG    xhp_CommandData
  223.     APTR    xhp_BufferPtr
  224.     LONG    xhp_BufferSize
  225.     LONG    xhp_DataPos    * current seek position
  226.     APTR    xhp_PrivatePtr
  227.     APTR    xhp_TagList    * allows to transport tags to hook (V9)
  228.  
  229. * xadHookAccess commands
  230. XADAC_READ        EQU    10    * get data
  231. XADAC_WRITE        EQU    11    * write data
  232. XADAC_COPY        EQU    12    * copy input to output
  233. XADAC_INPUTSEEK     EQU    13    * seek in input file
  234. XADAC_OUTPUTSEEK    EQU    14    * seek in output file
  235.  
  236. *************************************************************************
  237. *                                    *
  238. *    support structures                         *
  239. *                                    *
  240. *************************************************************************
  241.  
  242. * Own date structure to cover all possible dates in a human friendly
  243. * format. xadConvertDates may be used to convert between different date
  244. * structures and variables.
  245.     STRUCTURE xadDate,0
  246.     ULONG    xd_Micros    * values 0 to 999999
  247.     LONG    xd_Year     * values 1 to 2147483648
  248.     UBYTE    xd_Month    * values 1 to 12
  249.     UBYTE    xd_WeekDay    * values 1 to 7
  250.     UBYTE    xd_Day        * values 1 to 31
  251.     UBYTE    xd_Hour     * values 0 to 23
  252.     UBYTE    xd_Minute    * values 0 to 59
  253.     UBYTE    xd_Second    * values 0 to 59
  254.     LABEL    xadDate_SIZE
  255.  
  256. XADDAY_MONDAY        EQU    1    * monday is the first day and
  257. XADDAY_TUESDAY        EQU    2
  258. XADDAY_WEDNESDAY    EQU    3
  259. XADDAY_THURSDAY     EQU    4
  260. XADDAY_FRIDAY        EQU    5
  261. XADDAY_SATURDAY     EQU    6
  262. XADDAY_SUNDAY        EQU    7    * sunday the last day of a week
  263.  
  264.     STRUCTURE xadDeviceInfo,0    * for XAD_OUTDEVICE tag
  265.     APTR    xdi_DeviceName    * name of device
  266.     ULONG    xdi_Unit    * unit of device
  267.     APTR    xdi_DOSName    * instead of Device+Unit, dos name without ':'
  268.  
  269.     STRUCTURE xadSplitFile,0    * for XAD_INSPLITTED
  270.     APTR    xsf_Next
  271.     ULONG    xsf_Type    * XAD_INFILENAME, XAD_INFILEHANDLE, XAD_INMEMORY, XAD_INHOOK
  272.     ULONG    xsf_Size    * necessary for XAD_INMEMORY, useful for others
  273.     ULONG    xsf_Data    * FileName, Filehandle, Hookpointer or Memory
  274.  
  275.     STRUCTURE xadSkipInfo,0
  276.     APTR    xsi_Next
  277.     ULONG    xsi_Position    * position, where it should be skipped
  278.     ULONG    xsi_SkipSize    * size to skip
  279.  
  280.     STRUCTURE xadImageInfo,0    * for XADHC_IMAGEINFO
  281.     ULONG xii_SectorSize    * usually 512
  282.     ULONG xii_FirstSector    * of the image file
  283.     ULONG xii_NumSectors    * of the image file
  284.     ULONG xii_TotalSectors    * of this device type
  285.     * If the image file holds total data of disk xii_TotalSectors equals
  286.     * xii_NumSectors and xii_FirstSector is zero. Addition of xii_FirstSector
  287.     * and xii_NumSectors cannot exceed xii_TotalSectors value!
  288.  
  289. *************************************************************************
  290. *                                    *
  291. *    information structures                        *
  292. *                                    *
  293. *************************************************************************
  294.  
  295.     STRUCTURE xadArchiveInfo,0
  296.     APTR    xai_Client      * pointer to unarchiving client
  297.     APTR    xai_PrivateClient * private client data
  298.     APTR    xai_Password      * password for crypted archives
  299.     ULONG    xai_Flags      * read only XADAIF_ flags
  300.     ULONG    xai_LowCyl      * lowest cylinder to unarchive
  301.     ULONG    xai_HighCyl      * highest cylinder to unarchive
  302.     ULONG    xai_InPos      * input position, read only
  303.     ULONG    xai_InSize      * input size, read only
  304.     ULONG    xai_OutPos      * output position, read only
  305.     ULONG    xai_OutSize      * output file size, read only
  306.     APTR    xai_FileInfo      * data pointer for file arcs
  307.     APTR    xai_DiskInfo      * data pointer for disk arcs
  308.     APTR    xai_CurFile      * data pointer for current file arc
  309.     APTR    xai_CurDisk      * data pointer for current disk arc
  310.     LONG    xai_LastError      * last error, when XADAIF_FILECORRUPT (V2)
  311.     APTR    xai_MultiVolume   * array of start offsets from parts (V2)
  312.     APTR    xai_SkipInfo      * linked list of skip entries (V3)
  313.     APTR    xai_ImageInfo      * for filesystem clients (V5)
  314.     APTR    xai_InName      * Input archive name if available (V7)
  315.  
  316. * This structure is nearly complete private to either xadmaster or its
  317. * clients. An application program may access for reading only xai_Client,
  318. * xai_Flags, xai_FileInfo and xai_DiskInfo. For xai_Flags only XADAIF_CRYPTED
  319. * is useful. All the other stuff is private and should not be accessed!
  320.  
  321.     BITDEF XADAI,CRYPTED,0        * archive entries are encrypted
  322.     BITDEF XADAI,FILECORRUPT,1    * file is corrupt, but valid entries are in the list
  323.     BITDEF XADAI,FILEARCHIVE,2    * unarchive file entry
  324.     BITDEF XADAI,DISKARCHIVE,3    * unarchive disk entry
  325.     BITDEF XADAI,OVERWRITE,4    * overwrite the file (PRIVATE)
  326.     BITDEF XADAI,MAKEDIRECTORY,5    * create directory when missing (PRIVATE)
  327.     BITDEF XADAI,IGNOREGEOMETRY,6    * ignore drive geometry (PRIVATE)
  328.     BITDEF XADAI,VERIFY,7        * verify is turned on for disk hook (PRIVATE)
  329.     BITDEF XADAI,NOKILLPARTIAL,8    * do not delete partial files (PRIVATE)
  330.     BITDEF XADAI,DISKIMAGE,9    * is disk image extraction (V5)
  331.     BITDEF XADAI,FORMAT,10        * format in disk hook (PRIVATE)
  332.     BITDEF XADAI,NOEMPTYERROR,11    * do not create empty error (PRIVATE)
  333.     BITDEF XADAI,ONLYIN,12        * in stuff only (PRIVATE)
  334.     BITDEF XADAI,ONLYOUT,13     * out stuff only (PRIVATE)
  335.     BITDEF XADAI,USESECTORLABELS,14 * use SectorLabels (PRIVATE)
  336.  
  337.     STRUCTURE xadFileInfo,0
  338.     APTR    xfi_Next
  339.     ULONG    xfi_EntryNumber * number of entry
  340.     APTR    xfi_EntryInfo    * additional archiver text
  341.     APTR    xfi_PrivateInfo * client private, see XAD_OBJPRIVINFOSIZE
  342.     ULONG    xfi_Flags    * see XADFIF_xxx defines
  343.     APTR    xfi_FileName    * see XAD_OBJNAMESIZE tag
  344.     APTR    xfi_Comment    * see XAD_OBJCOMMENTSIZE tag
  345.     ULONG    xfi_Protection    * OS 3 bits (including multiuser)
  346.     ULONG    xfi_OwnerUID    * user ID
  347.     ULONG    xfi_OwnerGID    * group ID
  348.     APTR    xfi_UserName    * user name
  349.     APTR    xfi_GroupName    * group name
  350.     ULONG    xfi_Size    * size of this file
  351.     ULONG    xfi_GroupCrSize * crunched size of group
  352.     ULONG    xfi_CrunchSize    * crunched size
  353.     APTR    xfi_LinkName    * name and path of link
  354.     STRUCT    xfi_Date,xadDate_SIZE
  355.     UWORD    xfi_Generation    * File Generation [0...$FFFF] (V3)
  356.     ULONG    xfi_DataPos    * crunched data position (V3)
  357.     APTR    xfi_MacFork    * pointer to 2nd fork for Mac (V7)
  358.     UWORD    xfi_UnixProtect * protection bits for Unix (V11)
  359.     UBYTE    xfi_DosProtect    * protection bits for MS-DOS (V11)
  360.     UBYTE    xfi_FileType    * XADFILETYPE to define type of exe files (V11)
  361.     APTR    xfi_Special    * pointer to special data (V11)
  362.  
  363. * These are used for xfi_FileType to define file type. (V11)
  364. XADFILETYPE_DATACRUNCHER     EQU     1 * infile was only one data file
  365. XADFILETYPE_TEXTLINKER         EQU     2 * infile was text-linked
  366.  
  367. XADFILETYPE_AMIGAEXECRUNCHER EQU    11 * infile was an Amiga exe cruncher
  368. XADFILETYPE_AMIGAEXELINKER   EQU    12 * infile was an Amiga exe linker
  369. XADFILETYPE_AMIGATEXTLINKER  EQU    13 * infile was an Amiga text-exe linker
  370. XADFILETYPE_AMIGAADDRESS     EQU    14 * infile was an Amiga address cruncher
  371.  
  372. XADFILETYPE_UNIXBLOCKDEVICE  EQU    21 * this file is a block device
  373. XADFILETYPE_UNIXCHARDEVICE   EQU    22 * this file is a character device
  374. XADFILETYPE_UNIXFIFO         EQU    23 * this file is a named pipe
  375. XADFILETYPE_UNIXSOCKET         EQU    24 * this file is a socket
  376.  
  377. XADFILETYPE_MSDOSEXECRUNCHER EQU    31 * infile was an MSDOS exe cruncher
  378.  
  379. XADSPECIALTYPE_UNIXDEVICE    EQU    1 * xadSpecial entry is xadSpecialUnixDevice
  380. XADSPECIALTYPE_AMIGAADDRESS  EQU    2 * xadSpecial entry is xadSpecialAmigaAddress
  381.  
  382.     STRUCTURE xadSpecial,0
  383.     ULONG    xfis_Type        * XADSPECIALTYPE to define type of block (V11)
  384.     APTR    xfis_Next        * pointer to next entry
  385.     LABEL    xadSPECIAL_BASESIZE
  386.  
  387.     STRUCTURE xadSpecialUnixDevice,xadSPECIAL_BASESIZE
  388.     ULONG xfis_MajorVersion     * major device version
  389.     ULONG xfis_MinorVersion     * minor device version
  390.  
  391.     STRUCTURE xadSpecialAmigaAddress,xadSPECIAL_BASESIZE
  392.     ULONG xfis_JumpAddress        * code executaion start address
  393.     ULONG xfis_DecrunchAddress    * decrunch start of code
  394.  
  395.     STRUCTURE xadSpecialCBM8bit,xadSPECIAL_BASESIZE
  396.     UBYTE xfis_FileType        * File type XADCBM8BITTYPE_xxx
  397.     UBYTE xfis_RecordLength     * record length if relative file
  398. XADCBM8BITTYPE_UNKNOWN    EQU    $00    *     Unknown / Unused 
  399. XADCBM8BITTYPE_BASIC    EQU    $01    * Tape - BASIC program file
  400. XADCBM8BITTYPE_DATA    EQU    $02    * Tape - Data block (SEQ file)
  401. XADCBM8BITTYPE_FIXED    EQU    $03    * Tape - Fixed addres program file
  402. XADCBM8BITTYPE_SEQDATA    EQU    $04    * Tape - Sequential data file
  403. XADCBM8BITTYPE_SEQ    EQU    $81    * Disk - Sequential file "SEQ"
  404. XADCBM8BITTYPE_PRG    EQU    $82    * Disk - Program file "PRG"
  405. XADCBM8BITTYPE_USR    EQU    $83    * Disk - User-defined file "USR"
  406. XADCBM8BITTYPE_REL    EQU    $84    * Disk - Relative records file "REL"
  407. XADCBM8BITTYPE_CBM    EQU    $85    * Disk - CBM (partition) "CBM"
  408.  
  409. * Multiuser fields (xfi_OwnerUID, xfi_OwnerUID, xfi_UserName, xfi_GroupName)
  410. * and multiuser bits (see <dos/dos.h>) are currently not supported with normal
  411. * Amiga filesystem. But the clients support them, if archive format holds
  412. * such information.
  413.  
  414. * The protection bits (all 3 fields) should always be set using the
  415. * xadConvertProtection procedure. Call it with as much protection information
  416. * as possible. It extracts the relevant data at best (and also sets the 2 flags).
  417. * DO NOT USE these fields directly, but always through xadConvertProtection
  418. * call.
  419.  
  420.     BITDEF XADFI,CRYPTED,0        * entry is crypted
  421.     BITDEF XADFI,DIRECTORY,1    * entry is a directory
  422.     BITDEF XADFI,LINK,2        * entry is a link
  423.     BITDEF XADFI,INFOTEXT,3     * file is an information text
  424.     BITDEF XADFI,GROUPED,4        * file is in a crunch group
  425.     BITDEF XADFI,ENDOFGROUP,5    * crunch group ends here
  426.     BITDEF XADFI,NODATE,6        * no date supported, CURRENT date is set
  427.     BITDEF XADFI,DELETED,7        * file is marked as deleted (V3)
  428.     BITDEF XADFI,SEEKDATAPOS,8    * before unarchiving the datapos is set (V3)
  429.     BITDEF XADFI,NOFILENAME,9    * there was no filename, using internal one (V6)
  430.     BITDEF XADFI,NOUNCRUNCHSIZE,10    * file size is unknown and thus set to zero (V6)
  431.     BITDEF XADFI,PARTIALFILE,11    * file is only partial (V6)
  432.     BITDEF XADFI,MACDATA,12     * file is Apple data fork (V7)
  433.     BITDEF XADFI,MACRESOURCE,13    * file is Apple resource fork (V7)
  434.     BITDEF XADFI,EXTRACTONBUILD,14    * allows extract file during scanning (V10)
  435.     BITDEF XADFI,UNIXPROTECTION,15    * UNIX protection bits are present (V11)
  436.     BITDEF XADFI,DOSPROTECTION,16    * MSDOS protection bits are present (V11)
  437.     BITDEF XADFI,ENTRYMAYCHANGE,17    * this entry may change until GetInfo is finished (V11)
  438.     BITDEF XADFI,XADSTRFILENAME,18    * the xfi_FileName fields is an XAD string (V12)
  439.     BITDEF XADFI,XADSTRLINKNAME,19    * the xfi_LinkName fields is an XAD string (V12)
  440.     BITDEF XADFI,XADSTRCOMMENT,20    * the xfi_Comment fields is an XAD string (V12)
  441.  
  442. * NOTE: the texts passed with that structure must not always be printable.
  443. * Although the clients should add an additional (not counted) zero at the text
  444. * end, the whole file may contain other unprintable stuff (e.g. for DMS).
  445. * So when printing this texts do it on a byte for byte base including
  446. * printability checks.
  447.  
  448.     STRUCTURE xadTextInfo,0
  449.     APTR    xti_Next
  450.     ULONG    xti_Size    * maybe zero - no text - e.g. when crypted
  451.     APTR    xti_Text    * and there is no password in xadGetInfo()
  452.     ULONG    xti_Flags    * see XADTIF_xxx defines
  453.  
  454.     BITDEF    XADTI,CRYPTED,0 * entry is empty, as data was crypted
  455.     BITDEF    XADTI,BANNER,1    * text is a banner
  456.     BITDEF    XADTI,FILEDIZ,2 * text is a file description
  457.  
  458.     STRUCTURE xadDiskInfo,0
  459.     APTR    xdi_Next
  460.     ULONG    xdi_EntryNumber     * number of entry
  461.     APTR    xdi_EntryInfo        * additional archiver text
  462.     APTR    xdi_PrivateInfo     * client private, see XAD_OBJPRIVINFOSIZE
  463.     ULONG    xdi_Flags        * see XADDIF_xxx defines
  464.     ULONG    xdi_SectorSize
  465.     ULONG    xdi_TotalSectors    * see devices/trackdisk.h
  466.     ULONG    xdi_Cylinders        * to find out what these
  467.     ULONG    xdi_CylSectors        * fields mean, they are equal
  468.     ULONG    xdi_Heads        * to struct DriveGeometry
  469.     ULONG    xdi_TrackSectors
  470.     ULONG    xdi_LowCyl        * lowest cylinder stored
  471.     ULONG    xdi_HighCyl        * highest cylinder stored
  472.     ULONG    xdi_BlockInfoSize    * number of BlockInfo entries
  473.     APTR    xdi_BlockInfo        * see XADBIF_xxx defines and XAD_OBJBLOCKENTRIES tag
  474.     APTR    xdi_TextInfo        * linked list with info texts
  475.     ULONG    xdi_DataPos        * crunched data position (V3)
  476.  
  477. * BlockInfo points to a UBYTE field for every track from first sector of
  478. * lowest cylinder to last sector of highest cylinder. When not used,
  479. * pointer must be 0. Do not use it, when there are no entries!
  480. * This is just for information. The applications still asks the client
  481. * to unarchive whole cylinders and not archived blocks are cleared for
  482. * unarchiving.
  483.     BITDEF XADDI,CRYPTED,0        * entry is crypted
  484.     BITDEF XADDI,SEEKDATAPOS,1    * before unarchiving the datapos is set (V3)
  485.     BITDEF XADDI,SECTORLABELS,2    * the clients delivers sector labels (V9)
  486.     BITDEF XADDI,EXTRACTONBUILD,3    * allows extract disk during scanning (V10)
  487.     BITDEF XADDI,ENTRYMAYCHANGE,4    * this entry may change until GetInfo is finished (V11)
  488.  
  489. * Some of the crunchers do not store all necessary information, so it
  490. * may be needed to guess some of them. Set the following flags in that case
  491. * and geometry check will ignore these fields.
  492.     BITDEF XADDI,GUESSSECTORSIZE,5      * sectorsize is guessed (V10)
  493.     BITDEF XADDI,GUESSTOTALSECTORS,6  * totalsectors number is guessed (V10)
  494.     BITDEF XADDI,GUESSCYLINDERS,7      * cylinder number is guessed
  495.     BITDEF XADDI,GUESSCYLSECTORS,8      * cylsectors is guessed
  496.     BITDEF XADDI,GUESSHEADS,9      * number of heads is guessed
  497.     BITDEF XADDI,GUESSTRACKSECTORS,10 * tracksectors is guessed
  498.     BITDEF XADDI,GUESSLOWCYL,11      * lowcyl is guessed
  499.     BITDEF XADDI,GUESSHIGHCYL,12      * highcyl is guessed
  500.  
  501. * If it is impossible to set some of the fields, you need to set some of
  502. * these flags. NOTE: XADDIB_NOCYLINDERS is really important, as this turns
  503. * of usage of lowcyl and highcyl keywords. When you have cylinder information,
  504. * you should not use these and instead use guess flags and calculate
  505. * possible values for the missing fields.
  506.     BITDEF XADDI,NOCYLINDERS,15    * cylinder number is not set
  507.     BITDEF XADDI,NOCYLSECTORS,16    * cylsectors is not set
  508.     BITDEF XADDI,NOHEADS,17     * number of heads is not set
  509.     BITDEF XADDI,NOTRACKSECTORS,18    * tracksectors is not set
  510.     BITDEF XADDI,NOLOWCYL,19    * lowcyl is not set
  511.     BITDEF XADDI,NOHIGHCYL,20    * highcyl is not set
  512.  
  513. * defines for BlockInfo
  514.     BITDEF XADBI,CLEARED,0    * this block was cleared for archiving
  515.     BITDEF XADBI,UNUSED,1    * this block was not archived
  516.  
  517. *************************************************************************
  518. *                                    *
  519. *    progress report stuff                        *
  520. *                                    *
  521. *************************************************************************
  522.  
  523.     STRUCTURE xadProgressInfo,0
  524.     ULONG    xpi_Mode    * work modus
  525.     APTR    xpi_Client    * the client doing the work
  526.     APTR    xpi_DiskInfo    * current diskinfo, for disks
  527.     APTR    xpi_FileInfo    * current info for files
  528.     ULONG    xpi_CurrentSize * current filesize
  529.     ULONG    xpi_LowCyl    * for disks only
  530.     ULONG    xpi_HighCyl    * for disks only
  531.     ULONG    xpi_Status    * see XADPIF flags
  532.     LONG    xpi_Error    * any of the error codes
  533.     APTR    xpi_FileName    * name of file to overwrite (V2)
  534.     APTR    xpi_NewName    * new name buffer, passed by hook (V2)
  535. * NOTE: For disks CurrentSize is Sector*SectorSize, where SectorSize can
  536. * be found in xadDiskInfo structure. So you may output the sector value.
  537.  
  538. * different progress modes
  539. XADPMODE_ASK        EQU    1
  540. XADPMODE_PROGRESS    EQU    2
  541. XADPMODE_END        EQU    3
  542. XADPMODE_ERROR        EQU    4
  543. XADPMODE_NEWENTRY    EQU    5 * (V10)
  544. XADPMODE_GETINFOEND    EQU    6 * (V11)
  545.  
  546. * flags for progress hook and ProgressInfo status field
  547.     BITDEF XADPI,OVERWRITE,0    * overwrite the file
  548.     BITDEF XADPI,MAKEDIRECTORY,1    * create the directory
  549.     BITDEF XADPI,IGNOREGEOMETRY,2    * ignore drive geometry
  550.     BITDEF XADPI,ISDIRECTORY,3    * destination is a directory (V10)
  551.     BITDEF XADPI,RENAME,10        * rename the file (V2)
  552.     BITDEF XADPI,OK,16        * all ok, proceed
  553.     BITDEF XADPI,SKIP,17        * skip file
  554.  
  555. *************************************************************************
  556. *                                    *
  557. *    errors                                *
  558. *                                    *
  559. *************************************************************************
  560.  
  561. XADERR_OK        EQU    $0000 * no error
  562. XADERR_UNKNOWN        EQU    $0001 * unknown error
  563. XADERR_INPUT        EQU    $0002 * input data buffers border exceeded
  564. XADERR_OUTPUT        EQU    $0003 * output data buffers border exceeded
  565. XADERR_BADPARAMS    EQU    $0004 * function called with illegal parameters
  566. XADERR_NOMEMORY     EQU    $0005 * not enough memory available
  567. XADERR_ILLEGALDATA    EQU    $0006 * data is corrupted
  568. XADERR_NOTSUPPORTED    EQU    $0007 * command is not supported
  569. XADERR_RESOURCE     EQU    $0008 * required resource missing
  570. XADERR_DECRUNCH     EQU    $0009 * error on decrunching
  571. XADERR_FILETYPE     EQU    $000A * unknown file type
  572. XADERR_OPENFILE     EQU    $000B * opening file failed
  573. XADERR_SKIP        EQU    $000C * file, disk has been skipped
  574. XADERR_BREAK        EQU    $000D * user break in progress hook
  575. XADERR_FILEEXISTS    EQU    $000E * file already exists
  576. XADERR_PASSWORD     EQU    $000F * missing or wrong password
  577. XADERR_MAKEDIR        EQU    $0010 * could not create directory
  578. XADERR_CHECKSUM     EQU    $0011 * wrong checksum
  579. XADERR_VERIFY        EQU    $0012 * verify failed (disk hook)
  580. XADERR_GEOMETRY     EQU    $0013 * wrong drive geometry
  581. XADERR_DATAFORMAT    EQU    $0014 * unknown data format
  582. XADERR_EMPTY        EQU    $0015 * source file contains no files
  583. XADERR_FILESYSTEM    EQU    $0016 * unknown filesystem
  584. XADERR_FILEDIR        EQU    $0017 * name of file exists as directory
  585. XADERR_SHORTBUFFER    EQU    $0018 * buffer was to short
  586. XADERR_ENCODING     EQU    $0019 * text encoding was defective
  587.  
  588. *************************************************************************
  589. *                                    *
  590. *    characterset and filename conversion                *
  591. *                                    *
  592. *************************************************************************
  593.  
  594. CHARSET_HOST              EQU      0 * this is the ONLY destination setting for clients!
  595.  
  596. CHARSET_UNICODE_UCS2_HOST      EQU     10 * 16bit Unicode (usually no source type)
  597. CHARSET_UNICODE_UCS2_BIGENDIAN      EQU     11 * 16bit Unicode big endian storage
  598. CHARSET_UNICODE_UCS2_LITTLEENDIAN EQU     12 * 16bit Unicode little endian storage
  599. CHARSET_UNICODE_UTF8          EQU     13 * variable size unicode encoding
  600.  
  601. /* all the 1xx types are generic types which also maybe a bit dynamic
  602. CHARSET_AMIGA              EQU    100 * the default Amiga charset
  603. CHARSET_MSDOS               EQU    101 * the default MSDOS charset
  604. CHARSET_MACOS               EQU    102 * the default MacOS charset
  605. CHARSET_C64              EQU    103 * the default C64 charset
  606. CHARSET_ATARI_ST          EQU    104 * the default Atari ST charset
  607. CHARSET_WINDOWS              EQU    105 * the default Windows charset
  608.  
  609. * all the 2xx to 9xx types are real charsets, use them whenever you know
  610. * what the data really is
  611. CHARSET_ASCII              EQU    200 * the lower 7 bits of ASCII charsets
  612. CHARSET_ISO_8859_1          EQU    201 * the base charset
  613. CHARSET_ISO_8859_15          EQU    215 * Euro-sign fixed ISO variant
  614. CHARSET_ATARI_ST_US          EQU    300 * Atari ST (US) charset
  615. CHARSET_PETSCII_C64_LC          EQU    301 * C64 lower case charset
  616. CHARSET_CODEPAGE_437          EQU    400 * IBM Codepage 437 charset
  617. CHARSET_CODEPAGE_1252          EQU    401 * Windows Codepage 1252 charset
  618.  
  619. *************************************************************************
  620. *                                    *
  621. *    client related stuff                        *
  622. *                                    *
  623. *************************************************************************
  624.  
  625.     STRUCTURE xadForeman,0
  626.     ULONG    xfm_Security    * should be XADFOREMAN_SECURITY
  627.     ULONG    xfm_ID        * must be XADFOREMAN_ID
  628.     UWORD    xfm_Version    * set to XADFOREMAN_VERSION
  629.     UWORD    xfm_Reserved
  630.     APTR    xfm_VersString    * pointer to $VER: string
  631.     APTR    xfm_FirstClient * pointer to first client
  632.     LABEL    xadForman_SIZE
  633.  
  634. XADFOREMAN_SECURITY    EQU    $70FF4E75 * MOVEQ #-1,D0 and RTS
  635. XADFOREMAN_ID        EQU    $58414446 * 'XADF' identification ID
  636. XADFOREMAN_VERSION    EQU    1
  637.  
  638.     STRUCTURE xadClient,0
  639.     APTR    xc_Next
  640.     UWORD    xc_Version    * set to XADCLIENT_VERSION
  641.     UWORD    xc_MasterVersion
  642.     UWORD    xc_ClientVersion
  643.     UWORD    xc_ClientRevision
  644.     ULONG    xc_RecogSize    * needed size to recog the type
  645.     ULONG    xc_Flags    * see XADCF_xxx defines
  646.     ULONG    xc_Identifier    * ID of internal clients
  647.     APTR    xc_ArchiverName
  648.     APTR    xc_RecogData
  649.     APTR    xc_GetInfo
  650.     APTR    xc_UnArchive
  651.     APTR    xc_Free
  652.     LABEL    xadClient_SIZE
  653.  
  654. * function interface
  655. * ASM(BOOL) xc_RecogData(REG(d0, ULONG size), REG(a0, STRPTR data),
  656. *        REG(a6, struct xadMasterBase *xadMasterBase))
  657. * ASM(LONG) xc_GetInfo(REG(a0, struct xadArchiveInfo *ai),
  658. *        REG(a6, struct xadMasterBase *xadMasterBase))
  659. * ASM(LONG) xc_UnArchive(REG(a0, struct xadArchiveInfo *ai),
  660. *        REG(a6, struct xadMasterBase *xadMasterBase))
  661. * ASM(void) xc_Free(REG(a0, struct xadArchiveInfo *ai),
  662. *        REG(a6, struct xadMasterBase *xadMasterBase))
  663.  
  664.  
  665. * xc_RecogData returns 1 when recognized and 0 when not, all the others
  666. * return 0 when ok and XADERR values on error. xc_Free has no return
  667. * value.
  668.  
  669. * Filesystem clients need to clear xc_RecogSize and xc_RecogData. The
  670. * recognition is automatically done by GetInfo. XADERR_FILESYSTEM is
  671. * returned in case of unknown format. If it is known detection should
  672. * go on and any other code may be returned, if it fails.
  673. * The field xc_ArchiverName means xc_FileSystemName for filesystem
  674. * clients.
  675.  
  676. XADCLIENT_VERSION    EQU    1
  677.  
  678.     BITDEF XADC,FILEARCHIVER,0    * archiver is a file archiver
  679.     BITDEF XADC,DISKARCHIVER,1    * archiver is a disk archiver
  680.     BITDEF XADC,EXTERN,2        * external client, set by xadmaster
  681.     BITDEF XADC,FILESYSTEM,3    * filesystem clients (V5)
  682.     BITDEF XADC,NOCHECKSIZE,4    * do not check size for recog call (V6)
  683.     BITDEF XADC,DATACRUNCHER,5    * file archiver is plain data file (V11)
  684.     BITDEF XADC,EXECRUNCHER,6    * file archiver is executable file (V11)
  685.     BITDEF XADC,ADDRESSCRUNCHER,7    * file archiver is address crunched file (V11)
  686.     BITDEF XADC,LINKER,8        * file archiver is a linker file (V11)
  687.     BITDEF XADC,FREEXADSTRINGS,25    * master frees XAD strings (V12)
  688.     BITDEF XADC,FREESPECIALINFO,26    * master frees xadSpecial  structures (V11)
  689.     BITDEF XADC,FREESKIPINFO,27    * master frees xadSkipInfo structures (V3)
  690.     BITDEF XADC,FREETEXTINFO,28    * master frees xadTextInfo structures (V2)
  691.     BITDEF XADC,FREETEXTINFOTEXT,29 * master frees xadTextInfo text block (V2)
  692.     BITDEF XADC,FREEFILEINFO,30    * master frees xadFileInfo structures (V2)
  693.     BITDEF XADC,FREEDISKINFO,31    * master frees xadDiskInfo structures (V2)
  694.  
  695. *************************************************************************
  696. *                                    *
  697. *    client ID's                            *
  698. *                                    *
  699. *************************************************************************
  700.  
  701. * If an external client has set the xc_Identifier field, the internal
  702. * client is replaced.
  703.  
  704. * disk archivers start with 1000
  705. XADCID_XMASH            EQU    1000
  706. XADCID_SUPERDUPER3        EQU    1001
  707. XADCID_XDISK            EQU    1002
  708. XADCID_PACKDEV            EQU    1003
  709. XADCID_ZOOM            EQU    1004
  710. XADCID_ZOOM5            EQU    1005
  711. XADCID_CRUNCHDISK        EQU    1006
  712. XADCID_PACKDISK         EQU    1007
  713. XADCID_MDC            EQU    1008
  714. XADCID_COMPDISK         EQU    1009
  715. XADCID_LHWARP            EQU    1010
  716. XADCID_SAVAGECOMPRESSOR     EQU    1011
  717. XADCID_WARP            EQU    1012
  718. XADCID_GDC            EQU    1013
  719. XADCID_DCS            EQU    1014
  720.  
  721. * file archivers start with 5000
  722. XADCID_TAR            EQU    5000
  723. XADCID_SDSSFX            EQU    5001
  724. XADCID_LZX            EQU    5002
  725. XADCID_MXMSIMPLEARC        EQU    5003
  726. XADCID_LHPAK            EQU    5004
  727. XADCID_AMIGAPLUSUNPACK        EQU    5005
  728. XADCID_AMIPACK            EQU    5006
  729. XADCID_LHA            EQU    5007
  730. XADCID_LHASFX            EQU    5008
  731. XADCID_PCOMPARC         EQU    5009
  732. XADCID_SOMNI            EQU    5010
  733. XADCID_LHSFX            EQU    5011
  734. XADCID_XPKARCHIVE        EQU    5012
  735. XADCID_SHRINK            EQU    5013
  736. XADCID_SPACK            EQU    5014
  737. XADCID_SPACKSFX         EQU    5015
  738. XADCID_ZIP            EQU    5016
  739. XADCID_WINZIPEXE        EQU    5017
  740. XADCID_GZIP            EQU    5018
  741. XADCID_ARC            EQU    5019
  742. XADCID_ZOO            EQU    5020
  743. XADCID_LHAEXE            EQU    5021
  744. XADCID_ARJ            EQU    5022
  745. XADCID_ARJEXE            EQU    5023
  746. XADCID_ZIPEXE            EQU    5024
  747. XADCID_LHF            EQU    5025
  748. XADCID_COMPRESS         EQU    5026
  749. XADCID_ACE            EQU    5027
  750. XADCID_ACEEXE            EQU    5028
  751. XADCID_GZIPSFX            EQU    5029
  752. XADCID_HA            EQU    5030
  753. XADCID_SQ            EQU    5031
  754. XADCID_LHAC64SFX        EQU    5032
  755. XADCID_SIT            EQU    5033
  756. XADCID_SIT5            EQU    5034
  757. XADCID_SIT5EXE            EQU    5035
  758. XADCID_MACBINARY        EQU    5036
  759. XADCID_CPIO            EQU    5037
  760. XADCID_PACKIT            EQU    5038
  761.  
  762. * filesystem client start with 8000
  763. XADCID_FSAMIGA            EQU    8000
  764. XADCID_FSSANITYOS        EQU    8001
  765. XADCID_FSFAT            EQU    8002
  766.  
  767. * mixed archivers start with 9000
  768. XADCID_DMS            EQU    9000
  769. XADCID_DMSSFX            EQU    9001
  770.  
  771.     ENDC    ; LIBRARIES_XADMASTER_I
  772.